// 将路由模块抽离出来
// 1.导入vue-router 包
import VueRouter from 'vue-router';
// 导入对应的路由组件
import HomeContainer from './components/tabbar/homeContainer.vue';
import MemberContainer from './components/tabbar/member.vue';
import ShopcarContainer from './components/tabbar/shopCar.vue';
import searchContainer from  './components/tabbar/search.vue';
import NewsList from './components/news/NewsList.vue';
import NewsInfo from './components/news/newsInfo.vue';
import PhotoList from './components/photos/PhotoList.vue';
import PhotoInfo from './components/photos/photoInfo.vue';
import GoodsList from './components/goods/goodsList.vue';
import GoodsInfo from './components/goods/goodsinfo.vue';
import GoodsComments from './components/goods/goodsComments.vue';
import GoodsDesc from './components/goods/goodsDesc.vue';
//3. 创建路由对象
var router = new VueRouter({
    routes:[
        {path:'/', redirect:'/home'},
        {path:'/home', component:HomeContainer},
        {path:'/member', component:MemberContainer},
        {path:'/shopcar', component:ShopcarContainer},
        {path:'/search', component:searchContainer},
        {path: '/home/newslist', component:NewsList},
        {path: '/home/newsinfo/:id', component:NewsInfo},
        {path: '/home/photolist', component:PhotoList},
        {path:'/home/photoInfo/:id', component:PhotoInfo},
        {path:'/home/goodslist', component:GoodsList},
        {path:'/home/goodsinfo/:id', component:GoodsInfo, name:"goodsinfo"},
        {path:'/home/goodsdesc/:id', component:GoodsDesc, name:"goodsdesc"},
        {path:'/home/GoodsComments/:id', component: GoodsComments, name:"goodscomments"}
    ],
    linkActiveClass:'mui-active'
})
// 向外暴露路由模块
export default router;